/*
  将下面异步代码使用 Promise 的方法改进
  尽量用看上去像同步代码的方式
  setTimeout(function () {
    var a = 'hello'
    setTimeout(function () {
      var b = 'lagou'
      setTimeout(function () {
        var c = 'I ♥ U'
        console.log(a + b +c)
      }, 10)
    }, 10)
  }, 10)
*/



let pro=new Promise((resolve,reject)=>{
    var a='hello'
   setTimeout(()=>{
    resolve(a)
    // console.log(a)
   },500)
})

function pros(value,value2){
  return new Promise((resolve,reject)=>{
    setTimeout(()=>{
      debugger
      resolve(value+value2)
     },10)
})
}
async function ss (){

    let restul= await pro.then((data)=>{
      // console.log(data);
      return pros(data,'lagou')
    })

    let restul2=await pro.then((data)=>{
      // console.log(data);
      return pros(restul,'I ♥ U')
    })
    console.log(restul2)
    // console.log(restul3)
}
ss();



